//
//  APIBaseProtocol.swift
//  XiaoHongYi
//
//  Created by 杨东宝 on 2020/5/4.
//  Copyright © 2020 杨东宝. All rights reserved.
//

import Foundation
//协议扩展实现，全局baseURL，heade等设置
public extension TargetType{
    /// The target's base `URL`.
     var baseURL: URL {  return URL(string: "https://api.kytingting.com")! }

     /// The HTTP method used in the request.
     var method: Moya.Method { .get }

     /// Provides stub data for use in testing.
     var sampleData: Data {  return "".data(using: String.Encoding.utf8)!  }
   
     /// The headers to be used in the request.
     var headers: [String: String]? {
        
        let header = ["token":userManger.curUserInfo?.token ?? "","uuid":userManger.curUserInfo?.uuid ?? "","ua":UIDevice.deviceInfo()]
        
        return header
    }
}

